package com.luhuiguo.gwt.mvp.dispatcher.client.gin;

import com.google.gwt.inject.client.AbstractGinModule;
import com.luhuiguo.gwt.mvp.dispatcher.client.ExceptionHandler;

/**
 * Abstract base class that binds an instance of {@link ExceptionHandler} for use
 * by {@link com.luhuiguo.gwt.mvp.dispatcher.client.AbstractDispatcherAsync} implementations.
 *
 * @author LuHuiguo
 * @version $Id: AbstractDispatcherModule.java 8 2009-12-25 03:02:51Z luhuiguo $
 */
public class AbstractDispatcherModule extends AbstractGinModule {
    protected final Class<? extends ExceptionHandler> exceptionHandlerType;

    public AbstractDispatcherModule( Class<? extends ExceptionHandler> exceptionHandlerType ) {
        this.exceptionHandlerType = exceptionHandlerType;
    }

    @Override
    protected void configure() {
        bind( ExceptionHandler.class ).to( exceptionHandlerType );
    }
}
